﻿@page "/"
@inherits ProductManagementComponentBase
<div class="container">
    <div class="p-5 text-center">
        <Badge Color="Color.Success" class="mb-4">
            <h5 class="m-1"> <i class="fas fa-rocket"></i> Congratulations, <strong>ProductManagement</strong> is successfully running!</h5>
        </Badge>

        <h1>Welcome to the Application</h1>

        <h2>A list of products:</h2>

        <ul class="list-group">
            @foreach (var product in Products)
            {
                <li class="list-group-item">
                    @product.Name <br/>
                    <small>@product.Id.ToString()</small>
                </li>
            }
        </ul>
        <br/>

        @if (CurrentUser.IsAuthenticated)
        {
            var name = CurrentTenant.IsAvailable ? CurrentTenant.Name : "Host";
            
            <h2> Catalog list of @name:</h2>
            <ul class="list-group">
                @foreach (var catalog in Catalogs)
                {
                    <li class="list-group-item">
                        @catalog.Name <br/>
                        <small>@catalog.Id.ToString()</small>
                    </li>
                }
            </ul>
        }


        @if (!CurrentUser.IsAuthenticated)
        {
            <a class="btn btn-primary" href="/authentication/login">
                <i class="fa fa-sign-in-alt"></i> @L["Login"]
            </a>
        }
    </div>
</div>